home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / mactool / hyperins.cpt / Hyper Installer / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1991-10-15  |  5.8 KB  |  22 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>3</cardCount>
  7.     <cardID>3022</cardID>
  8.     <listID>2087</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><true /></cantDelete>
  11.     <cantAbort><true /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on openStack
  17. -- Needs: User preferences card of the home stack
  18. -- remembers user specified preferences for later
  19. global Stacks,Applications,Documents,UserName,userLevelprefs
  20. lock screen
  21. set lockRecent to true
  22. set lockMessages to true
  23. push this card -- remember where we are
  24. go home -- will take us to the home stack in case we're not there
  25. put cd fld "User Level" of cd "User Preferences" into userLevelprefs
  26. pop card -- return to where we were
  27. set lockRecent to false -- clean up for exit
  28. set lockMessages to false
  29. unlock screen
  30. go to card 1
  31. get the short name of cd btn id 37
  32. if it = "Administrative" then set userLevel to 1
  33. if it = "Set Up for Use" then set userLevel to 5
  34. if the userLevel < 5 then
  35. set the cantModify of this stack to false
  36. set the cantAbort of this stack to true
  37. hide MenuBar
  38. disable menu "Go"
  39. disable menu "Edit"
  40. disable menu "File"
  41. set the cantModify of this stack to true
  42. else
  43. end if
  44. show cd btn "Go"
  45. show cd btn "Cancel"
  46. show cd btn id 37
  47. end openStack
  48.  
  49. on closeStack
  50. global userLevelprefs
  51. set userLevel to userLevelprefs
  52. end closeStack
  53.  
  54. on idle
  55. get the userLevel
  56. if it < 5 then
  57. hide card button "Administration" of card 1
  58. hide card button "Open User Log" of card 1
  59. hide card button "Close User Log" of card 1
  60. hide card button "Clear User Log" of card 1
  61. hide card button "User Log Name" of card 1
  62. hide card button "Help" of card 1
  63. go to cd 1
  64. else
  65. show card button "Administration" of card 1
  66. show card button "Open User Log" of card 1
  67. show card button "Close User Log" of card 1
  68. show card button "User Log Name" of card 1
  69. show card button "Help" of card 1
  70. end if
  71. end idle
  72.  
  73. on arrowKey
  74. get the userLevel
  75. if it < 5 then
  76. beep
  77. else
  78. pass arrowKey
  79. end if
  80. end arrowKey
  81.  
  82. on showError
  83. global usersVolume,sourceFile,destFile,loopCount,sourceFolder,┬¼
  84. destFolder,folderName,erasefolder,error,success,job,SDCount,¬
  85. buttonName,errMessage
  86. if error = -1 then
  87. put "Not enough memory to copy" into error
  88. put "Ran out of RAM memory during installation......aborting!"┬¼
  89. into errMessage
  90. abortInstall
  91. else
  92. if error = 1 then
  93. put "Cannot open source file (file not found)" into error
  94. put "Can't read the file...aborting!" into errMessage
  95. abortInstall
  96. else
  97. if error = 2 then
  98. put "Cannot create destination file" into error
  99. put "Can't create the file...aborting!" into errMessage
  100. abortInstall
  101. else
  102. if error = 4 then
  103. put "Error reading source file" into error
  104. put "Can't read the file...aborting!" into errMessage
  105. abortInstall
  106. else
  107. if error = 5 then
  108. put "Error writing output file" into error
  109. put "Can't create the new file...aborting!" into errMessage
  110. abortInstall
  111. else
  112. if error = "Error : File is busy" then
  113. put "You must QUIT all applications before running this installer"┬¼
  114. into errMessage
  115. abortInstall
  116. else
  117. if error = "Error : I/O Error" then
  118. put "There was a disk error...aborting!" into errMessage
  119. abortInstall
  120. else
  121. if error = "Error : Folder is full" then
  122. put "Not enough room in your folder...aborting!" into errMessage
  123. abortInstall
  124. else
  125. if error = "Error : Appleshare insufficient priveleges" then
  126. put "Appleshare priveleges are set incorrectly...aborting!" into errMessage
  127. abortInstall
  128. end if
  129. end if
  130. end if
  131. end if
  132. end if
  133. end if
  134. end if
  135. end if
  136. end if
  137. if error = "0" then put "No error..." into error
  138. if error is empty then put "No error..." into error
  139. if error = 3 then put┬¼
  140. "File already exists on user's drive...skipping." into error
  141. writeLog
  142. end showError
  143.  
  144. on writeLog
  145. global usersVolume,sourceFile,destFile,loopCount,sourceFolder,┬¼
  146. destFolder,folderName,erasefolder,error,success,job,SDCount,¬
  147. buttonName,errMessage
  148. get cd fld "Log Name"
  149. put it into logName
  150. Open file logName
  151. read from file logName until end
  152. write job & return to file logName
  153. write cd fld "SourceField" & return to file logName
  154. write cd fld "DestField" & return to file logName
  155. write error & return to file logName
  156. close file logName
  157. end writeLog
  158.  
  159. on success
  160. play "Hallelujah"
  161. wait until the sound is done
  162. end success
  163.  
  164. on unSuccess
  165. global errMessage
  166. play "Buzzer"
  167. put errMessage
  168. answer "Installation was Not Successful!!!  Reason shown below." with┬¼
  169. "OK"
  170. end unSuccess
  171.  
  172. on abortInstall
  173. global usersVolume,sourceFile,destFile,loopCount,sourceFolder,┬¼
  174. destFolder,folderName,erasefolder,error,success,job,SDCount,¬
  175. buttonName,errMessage
  176. put "Not Successful!!!" into success
  177. writeLog
  178. unSuccess
  179. finishUp
  180. end abortInstall
  181.  
  182. on finishUp
  183. global usersVolume,sourceFile,destFile,loopCount,sourceFolder,┬¼
  184. destFolder,folderName,erasefolder,error,success,job,SDCount,¬
  185. buttonName,errMessage
  186. put empty into cd fld "SourceField"
  187. put "Installation finished" into cd fld "Destfield"
  188. put empty into error
  189. if success = "Not Successful!!!" then put "Installation NOT Successful"┬¼
  190. into error
  191. put "Installation " & success into cd fld "Misc."
  192. put "Installation " & success into job
  193. showError
  194. if success = "Successful!!!" then Success
  195. wait 1 second
  196. put empty into cd fld "Destfield"
  197. put empty into cd fld "Misc."
  198. hide cd fld "SourceField"
  199. hide cd fld "DestField"
  200. Hide cd fld "Misc."
  201. show button "Go"
  202. show button "Cancel"
  203. show button id 37
  204. doMenu "Quit HyperCard"
  205. if success = "Not Successful!!!" then play "DragnetBeep"
  206. wait until the sound is done
  207. if success = "Not Successful!!!" then exit to Hypercard
  208. end finishUp
  209. </script>
  210.     <background id="2642" file="background_2642.xml" name="Main Background" />
  211.     <card id="3022" file="card_3022.xml" marked="false" name="Card 1" owner="2642" />
  212.     <card id="3883" file="card_3883.xml" marked="false" name="Files Card" owner="2642" />
  213.     <card id="5085" file="card_5085.xml" marked="false" name="Folders Card" owner="2642" />
  214. </stack>
  215.